home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-20 | 9.4 KB | 291 lines | [TEXT/MPS ] |
- /*
-
- ####################################################################
- Internet PMSAM Sample Address Template
- 1.0b1 version
-
- Steve Falkenburg
- MacDTS 2/11/93
- AppleLink DEVSUPPORT for questions (if you're a supported seed site)
- ####################################################################
-
- This template is a generic personal MSAM address template where the additional
- extension information is a single RString with the external system address in
- a single string representation. In addition, there is an info-page field for
- changing the name of the address (which can also be done from the address sublist)
-
- To adapt for your own use, just modify the contents of the file "SpecificAddress.r"
-
- to build:
-
- Rez -i "{CIncludes}" "GenericAddress.r" -append -o InternetAddress
- SetFile -t 'detf' InternetAddress
-
- */
-
- #ifndef __TYPES__
- #include "Types.r"
- #endif
-
- #ifndef __OCE.R__
- #include "OCE.r"
- #endif
-
- #ifndef __OCE__
- #include "OCE.h"
- #endif
-
- #ifndef __OCETEMPLATES__
- #include "OCETemplates.h"
- #endif
-
-
-
- // our properties ########################################################################
-
- #define kXtnType kDETFirstDevProperty
- #define kPrDNodeNumber (kDETFirstDevProperty+1)
- #define kPrDirName (kDETFirstDevProperty+2)
- #define kPrDirDiscA (kDETFirstDevProperty+3)
- #define kPrDirDiscB (kDETFirstDevProperty+4)
- #define kPrPart1 (kDETFirstDevProperty+5)
- #define kPrPart2 (kDETFirstDevProperty+6)
- #define kPrPart3 (kDETFirstDevProperty+7)
- #define kPrNumOfPathParts (kDETFirstDevProperty+8)
- #define kPrCidSource (kDETFirstDevProperty+9) /* long 00000000*/
- #define kPrCidSequence (kDETFirstDevProperty+10) /* long 00000000*/
- #define kPrEntityName (kDETFirstDevProperty+11)
- #define kPrEnitiyType (kDETFirstDevProperty+12) /* RSrting " User" */
- #define kPrAddress (kDETFirstDevProperty+13) // Inet Address RString
-
-
-
- // type declarations that we need ########################################################
-
- // here's a convenience type declaration for defining our 'detb' resource
- // if you want to use this to set up an address template for your personal
- // MSAM, you all you should have to change is the resource 'detb' declaration,
- // not this type
-
- type 'detb' {
- longInt; // address type (you fill in)
- integer = (end1-start1)/8; // length of all data following
- start1:
- longInt; // address type (you fill in)
- integer = (endPRID-startPRID)/8; // length of packed recordid
- startPRID:
- integer = (endRLI-startRLI)/8; // length of packed rli
- startRLI:
- longInt = 0; // dNode # (0)
- rstring; // directory name (you fill in)
- align word;
- longInt; // discriminator A (you fill in)
- longInt = 0; // discriminator B
- integer = (endPackedPath-startPackedPath)/8; // packed pathname size
- startPackedPath:
- integer = 3; // # of pathname parts (3)
- longInt = 0; // path part 1 (0)
- longInt = 0; // path part 2 (0)
- longInt = 0; // path part 3 (0)
- endPackedPath:
- endRLI:
- longInt = 0; // CreationID source (0)
- longInt = 0; // CreationID seq (0)
- rstring; // name RString (you fill in)
- align word;
- rstring; // type RString (you fill in)
- align word;
- endPRID:
- rstring; // extension value (you fill in)
- align word;
- end1:
- };
-
-
-
- // template ID ranges ##################################################################
-
- // note that we used resource IDs starting way up at 5000, since this template
- // will be rezzed into an MSAM which also has a setup template, so we don't want
- // to use the same DET resource ID space
-
- #define kAddressAspect (5000) // aspect
- #define kAddressInfoPage (5000+kDETIDSep) // info page
- #define kAddressRecordType kUserRecTypeBody
-
- #define kAttributeInfoWindHeight 200
- #define kAttributeInfoWindWidth 259
-
- // information specific to your address template #######################################
-
- #include "SpecificAddress.r"
-
-
- // aspect template (used for both main and info page aspects) ###########################
-
- // 'deta' this is a aspect template
- resource 'deta' (kAddressAspect, purgeable) { 0, dropCheckConflicts, isMainAspect };
-
- // template name
- resource 'rstr' (kAddressAspect+kDETTemplateName, purgeable) {
- kAspectTemplateName
- };
-
- // the kind is address
- resource 'rstr' (kAddressAspect+kDETAspectKind, purgeable) {
- kAspectKind
- };
-
- // new menu name
- resource 'rstr' (kAddressAspect+kDETAspectNewMenuName, purgeable) {
- kNewMenuName
- };
-
- // this template apply to the kMailSlotsAttrTypeBody attribute
- resource 'rstr' (kAddressAspect+kDETAttributeType, purgeable) {
- kMailSlotsAttrTypeBody
- };
-
- // tag of attribute this applies to
- resource 'detn' (kAddressAspect+kDETAttributeValueTag)
- {
- kSignature
- };
-
- // category for template
- resource 'rst#' (kAddressAspect+kDETAspectCategory, purgeable) {
- {kDETCategoryAddressItems}
- };
-
- // custom window size for address templates
- resource 'detw' (kAddressAspect+kDETAspectInfoPageCustomWindow, purgeable) {
- {0, 0, kAttributeInfoWindHeight, kAttributeInfoWindWidth},
- discludePopUp
- };
-
- // dett attribute look up table
- // if you want to change this table, do change kDETAspectNewValue detb to match the new table
- // the table is for a personal MSAM address with an RString as the extension value
- resource 'dett' (kAddressAspect+kDETAspectLookup, purgeable)
- {{
- {kMailSlotsAttrTypeBody},
- kSignature,
- useForInput,
- useForOutput,
- notInSublist,
- isNotAlias,isNotRecordRef,
- // mailslot attribute
- {
-
- // unused fields here
-
- /* generic stuff (no changes needed) */
-
- 'wsiz', kDETNoProperty, 0; // length of indented data
- '((((', kDETNoProperty, 0;
- 'long', kXtnType, 0; // extension type
- 'wsiz', kDETNoProperty, 0; // packed record ID length
- '((((', kDETNoProperty, 0;
- 'wsiz', kDETNoProperty, 0; // RLI length
- '((((', kDETNoProperty, 0;
- 'long', kPrDNodeNumber, 0; // dNode # (0 for us)
- 'rstr', kPrDirName, 0; // directory name
- 'awrd', kDETNoProperty, 0;
- 'long', kPrDirDiscA, 0; // directory disc 1 (our signature)
- 'long', kPrDirDiscB, 0; // directory disc 2 (0L)
- 'wsiz', kDETNoProperty, 0;
- '((((', kDETNoProperty, 0; // packed pathname length
- 'word', kPrNumOfPathParts, 0; // # of parts (3)
- 'rstr', kPrPart1, 0; // part 1 ("")
- 'awrd', kDETNoProperty, 0;
- 'rstr', kPrPart2, 0; // part 2 ("")
- 'awrd', kDETNoProperty, 0;
- 'rstr', kPrPart3, 0; // part 3 ("")
- 'awrd', kDETNoProperty, 0;
- '))))', kDETNoProperty, 0;
- '))))', kDETNoProperty, 0;
- 'long', kPrCidSource, 0; // creation ID source
- 'long', kPrCidSequence, 0; // creation ID seq
- 'rstr', kDETAspectName, 0; // name of this address (RString)
- 'awrd', kDETNoProperty, 0;
- 'rstr', kPrEnitiyType, 0; // entity type (aoce User)
- 'awrd', kDETNoProperty, 0;
- '))))', kDETNoProperty, 0;
-
- /* specific address information */
-
- 'rstr', kPrAddress, 0; // your address (RString)
- 'awrd', kDETNoProperty, 0;
-
- '))))', kDETNoProperty, 0;
- 'Pref', kDETNoProperty, 0 // save pref mailslot (built-in code)
- };
- }};
-
-
- // info-page template #################################################################
-
- // item location in inforpage template window
-
- #define kLineTop (kDETSubpageIconBottom+32)
- #define kLineBottom kLineTop+1
- #define kAddressTop (kLineBottom+10)
- #define kAddressBottom (kAddressTop + kDETAppFontLineHeight+4)
-
- #define kMy1stColumnLeft 8
- #define kMy1stColumnRight 76
- #define kMy2ndColumnLeft 80
- #define kMy2ndColumnRight kAttributeInfoWindWidth - 16
-
- // info page (view) template ('deti')
- resource 'deti' (kAddressInfoPage, purgeable) {
- 1000, // template sort order
- kDETNoSublistRect,
- noSelectFirstText,
- {
- kDETNoProperty, kDETNoProperty, kAddressInfoPage;
- },
- {}
- };
-
- // this is the name of the InfoPage template, don't use the same name as your aspect name
- resource 'rstr' (kAddressInfoPage+kDETTemplateName, purgeable) {
- kInfoPageTemplateName
- };
-
- // this template applies to the kMailSlotsAttrTypeBody attribute
- resource 'rstr' (kAddressInfoPage+kDETAttributeType, purgeable) {
- kMailSlotsAttrTypeBody
- };
-
- // title of the built-in info page view popup
- resource 'rstr' (kAddressInfoPage+kDETInfoPageName, purgeable) {
- kPopUpTitle
- };
-
- // this is to relate the info page to the right aspect
- // this needs to be the same string as the kDETTemplateName of the aspect template
- resource 'rstr' (kAddressInfoPage+kDETInfoPageMainViewAspect, purgeable) {
- kAspectTemplateName
- };
-
-
- // our view resource. this defines the locations of the user interface elements
- // in the info-page window.
- resource 'detv' (kAddressInfoPage, purgeable)
- {
- {
- kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
- Bitmap { kDETLargeIcon };
-
- {kLineTop,kMy1stColumnLeft,kLineBottom,(kAttributeInfoWindWidth-8)}, kDETNoFlags, kDETNoProperty,
- Box { kDETBoxIsGrayed };
-
- {kAddressTop, kMy1stColumnLeft, kAddressBottom, kMy1stColumnRight}, kDETNoFlags, kDETNoProperty,
- StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,"Address:" };
-
- {kAddressTop, kMy2ndColumnLeft, kAddressBottom, kMy2ndColumnRight}, kDETNoFlags, kPrAddress,
- EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
- };
- };
-